package cn.cy.structure.composite.general;

/**
 * @author yangxq
 * @desc
 * @date 2025-05-20
 */
public class GeneralClient {

    public static void main(String[] args) {
        Folder root = new Folder("Root");
        File file1 = new File("Document.txt");
        Folder subFolder = new Folder("SubFolder");
        File file2 = new File("Image.jpg");

        root.addFile(file1);       // 添加文件
        root.addFolder(subFolder); // 添加子文件夹
        subFolder.addFile(file2);  // 子文件夹添加文件

        root.printStructure(0);
    }

}
